from pydantic import BaseModel


class PostBase(BaseModel):
    post_title: str
    post_content: str
    post_file: list[str] = []
    author: str


class PostCreate(PostBase):
    pass


class Post(PostBase):
    post_id: int
    reviewed: bool = False

    class Config:
        from_attributes = True


class UserBase(BaseModel):
    email: str
    username: str


class UserCreate(UserBase):
    password: str
    captcha: str


class UserLogin(BaseModel):
    username: str
    password: str


class User(UserBase):
    userid: int
    role: int
    posts: list[Post] = []

    class Config:
        from_attributes = True


class Banner(BaseModel):
    content: str
    date: str
